/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Francisco
 */
@Entity
@Table(name = "transferencia_ingreso")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TransferenciaIngreso.findAll", query = "SELECT t FROM TransferenciaIngreso t"),
    @NamedQuery(name = "TransferenciaIngreso.findByIdTransferenciaIngreso", query = "SELECT t FROM TransferenciaIngreso t WHERE t.idTransferenciaIngreso = :idTransferenciaIngreso"),
    @NamedQuery(name = "TransferenciaIngreso.findByMonto", query = "SELECT t FROM TransferenciaIngreso t WHERE t.monto = :monto"),
    @NamedQuery(name = "TransferenciaIngreso.findByEstatusTransferecnia", query = "SELECT t FROM TransferenciaIngreso t WHERE t.estatusTransferecnia = :estatusTransferecnia")})
public class TransferenciaIngreso implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_transferencia_ingreso")
    private Integer idTransferenciaIngreso;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "monto")
    private BigDecimal monto;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 1)
    @Column(name = "estatus_transferecnia")
    private String estatusTransferecnia;
    @JoinColumn(name = "id_ingreso", referencedColumnName = "id_ingreso")
    @ManyToOne(optional = false)
    private Ingreso idIngreso;
    @JoinColumn(name = "id_usuario_destino", referencedColumnName = "id_usuario")
    @ManyToOne(optional = false)
    private Usuario idUsuarioDestino;

    public TransferenciaIngreso() {
    }

    public TransferenciaIngreso(Integer idTransferenciaIngreso) {
        this.idTransferenciaIngreso = idTransferenciaIngreso;
    }

    public TransferenciaIngreso(Integer idTransferenciaIngreso, BigDecimal monto, String estatusTransferecnia) {
        this.idTransferenciaIngreso = idTransferenciaIngreso;
        this.monto = monto;
        this.estatusTransferecnia = estatusTransferecnia;
    }

    public Integer getIdTransferenciaIngreso() {
        return idTransferenciaIngreso;
    }

    public void setIdTransferenciaIngreso(Integer idTransferenciaIngreso) {
        this.idTransferenciaIngreso = idTransferenciaIngreso;
    }

    public BigDecimal getMonto() {
        return monto;
    }

    public void setMonto(BigDecimal monto) {
        this.monto = monto;
    }

    public String getEstatusTransferecnia() {
        return estatusTransferecnia;
    }

    public void setEstatusTransferecnia(String estatusTransferecnia) {
        this.estatusTransferecnia = estatusTransferecnia;
    }

    public Ingreso getIdIngreso() {
        return idIngreso;
    }

    public void setIdIngreso(Ingreso idIngreso) {
        this.idIngreso = idIngreso;
    }

    public Usuario getIdUsuarioDestino() {
        return idUsuarioDestino;
    }

    public void setIdUsuarioDestino(Usuario idUsuarioDestino) {
        this.idUsuarioDestino = idUsuarioDestino;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTransferenciaIngreso != null ? idTransferenciaIngreso.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TransferenciaIngreso)) {
            return false;
        }
        TransferenciaIngreso other = (TransferenciaIngreso) object;
        if ((this.idTransferenciaIngreso == null && other.idTransferenciaIngreso != null) || (this.idTransferenciaIngreso != null && !this.idTransferenciaIngreso.equals(other.idTransferenciaIngreso))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.TransferenciaIngreso[ idTransferenciaIngreso=" + idTransferenciaIngreso + " ]";
    }
    
}
